package com.xyz.frame.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xyz.frame.common.response.PageObject;
import com.xyz.frame.dao.SmsCodeMapper;
import com.xyz.frame.bean.model.SmsCodeEntity;
import com.xyz.frame.service.SmsCodeService;
import org.springframework.stereotype.Service;

import java.util.Map;



@Service("smsCodeService")
public class SmsCodeServiceImpl
        extends ServiceImpl<SmsCodeMapper, SmsCodeEntity>
        implements SmsCodeService {

    @Override
    public PageObject queryPage(Map<String, Object> params) {
        long pageSize = Long.parseLong((String)params.get("limit"));
        long pageNum = Long.parseLong((String)params.get("page"));;
        IPage<SmsCodeEntity> page = this.page(
                new Page<>(pageNum, pageSize)
        );

        return new PageObject(page);
    }

}